<nz-drawer [nzClosable]="false" [nzVisible]="visible" nzPlacement="right" nzWidth="30%" nzTitle="设备报废"
           [nzFooter]="footerTpl"
           (nzOnClose)="close()">
  <form nz-form nzLayout="vertical" nz-row [formGroup]="validateForm" (ngSubmit)="submitForm()">

    <nz-form-item nz-col nzSpan="12">
      <nz-form-label nzFor="scrappedDateTime"> 报废日期</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <nz-date-picker nzSize="small" id="scrappedDateTime" formControlName="scrappedDateTime" [nzFormat]="dateFormat" [nzMode]="'date'"
                        (ngModelChange)="onChange($event)"></nz-date-picker>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item nz-col nzSpan="12">
      <nz-form-label nzFor="scrappedUserId"> 操作人</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <nz-select nzSize="small"  formControlName="scrappedUserId" id="scrappedUserId">
          <nz-option *ngFor="let item of deviceGroups" [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item nz-col nzSpan="24">
      <nz-form-label nzFor="scrappedReason"> 报废原因</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleCode!">
        <input nzSize="small" nz-input id="scrappedReason" formControlName="scrappedReason"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item nz-col nzSpan="24">
      <nz-form-label nzFor="scrappedMemo"> 备注</nz-form-label>
      <nz-form-control
        [nzValidateStatus]="validateForm.controls['scrappedMemo']"
        nzErrorTip="Please input your phone url!"
      >
        <textarea formControlName="memo" id="scrappedMemo" nz-input rows="2" placeholder="write any thing"></textarea>
      </nz-form-control>
    </nz-form-item>

  </form>

  <ng-template #footerTpl>
    <div style="float: right">
      <button nz-button style="margin-right: 8px;" (click)="close()">取消</button>
      <button nz-button nzType="primary" (click)="submitForm()">保存</button>
    </div>
  </ng-template>

</nz-drawer>
